package com.gxa.controller.wgl.businessController;

import com.gxa.common.R;
import com.gxa.common.vo.AttendancePageRequest;
import com.gxa.service.BusinessService;
import io.swagger.annotations.*;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;



/**
 * 商业报表
 */
@Controller
@RequestMapping(value = "/business/businessReport")
@Api(value = "商业智能",tags = "商业智能管理接口API")
@RequiresRoles(value = {"超级管理员","院长","主任"},logical = Logical.OR)
public class BusinessController {


    @Autowired
    BusinessService service;
    /**
     * 商业报表
     * @return
     */
    @RequestMapping(value = "/count",method = RequestMethod.POST)
    @ApiOperation(value = "统计各项",notes = "统计各项",httpMethod = "POST", response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="登录成功"),
            @ApiResponse(code=400,message="代表参数格式不对"),
            @ApiResponse(code=404,message="代表找不到此请求"),
            @ApiResponse(code=500,message="代表后端代码出现异常"),
    })
    @ResponseBody
    public R count(@ApiParam(name = "attendancePageRequest", value = "考勤实体", required = true) @RequestBody(required = false) AttendancePageRequest attendancePageRequest){
        return service.showBusinessReport(attendancePageRequest);
    }
}
